<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>b5laravelcmf</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="csrf-token" content="HqUkAyvAJtGfU7LglOyhHFnkT7slOCHcDouCDxXY">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="/static/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="/static/plugins/fontawesome/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="/static/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet"/>
    <link href="/static/plugins/layui/css/layui.css" rel="stylesheet">
    <link href="/static/plugins/animate/animate.css" rel="stylesheet"/>
    <link href="/static/admin/css/style.css" rel="stylesheet"/>
    <link href="/static/admin/css/iframe-ui.css" rel="stylesheet"/>
    <script>
        var bootUrl = {
            url: '/admin/menu/index',
            createUrl: '/admin/menu/create',
            updateUrl: '/admin/menu/update',
            removeUrl: '/admin/menu/remove',
            removeAllUrl: '/admin/menu/removeAll',
            clearCacheUrl: '/admin/menu/clearCache',
        }
    </script>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <div class="select-list">
                    <ul>
                        <li>菜单名称：
                            <input
                                    type=" text "
                                    name="like[name]"
                                    value=""
                                    autocomplete="off"
                            />


                        </li>
                        <li>菜单状态：
                            <select
                                    name="where[status]"
                            >
                                <option value="">所有</option>
                                <option value="1"

                                >正常</option>
                                <option value="0"

                                >停用</option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success "
               onclick="$.operate.add('',this)"
               data-width=""
               data-height=""
            >
                <i class="fa fa-plus"></i> 新增
            </a>

            <a
                    class="btn btn-primary single "
                    onclick="$.operate.edit('',this)"
            >
                <i class="fa fa-edit"></i> 修改
            </a>

            <a class="btn btn-info" id="expendinfobtn"><i class="fa fa-exchange"></i> 展开/折叠</a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-tree-table"></table>
        </div>
    </div>
</div>
<script src="/static/plugins/jquery/jquery-1.12.4.min.js"></script>
<script src="/static/plugins/bootstrap/js/bootstrap.min.js?v=asdasd"></script>
<!-- bootstrap-table 表格插件 -->
<script src="/static/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/static/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="/static/plugins/bootstrap-table/extensions/mobile/bootstrap-table-mobile.min.js"></script>
<!-- jquery-validate 表单验证插件 -->
<script src="/static/plugins/validate/jquery.validate.min.js"></script>
<script src="/static/plugins/validate/messages_zh.min.js"></script>
<script src="/static/plugins/validate/jquery.validate.extend.js"></script>
<script src="/static/plugins/bootstrap-treetable/bootstrap-treetable.js"></script>
<script src="/static/plugins/blockUI/jquery.blockUI.js"></script>
<script src="/static/plugins/iCheck/icheck.min.js"></script>
<script src="/static/plugins/layui/layui.js"></script>
<script src="/static/admin/js/iframe-ui.js"></script>
<script src="/static/admin/js/common.js"></script>
<script>
    var datas = '';
    $(function() {
        var options = {
            modalName: "菜单",
            columns: [{
                field: 'selectItem',
                radio: true
            },
                {
                    title: '菜单名称',
                    field: 'name',
                    formatter: function(value, row, index) {
                        if ($.common.isEmpty(row.icon)) {
                            return row.name;
                        } else {
                            return '<i class="' + row.icon + '"></i> <span class="nav-label">' + row.name + '</span>';
                        }
                    }
                },
                {field: 'sort', title: '排序',},
                {
                    field: 'url',
                    title: '请求地址',
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                {
                    title: '类型',
                    field: 'type',
                    formatter: function(value, item, index) {
                        if (item.type == 'M') {
                            return '<span class="label label-success">目录</span>';
                        }
                        else if (item.type == 'C') {
                            return '<span class="label label-primary">菜单</span>';
                        }
                        else if (item.type == 'F') {
                            return '<span class="label label-warning">按钮</span>';
                        }
                    }
                },
                {
                    field: 'status',
                    title: '可见',
                    formatter: function(value, row, index) {
                        if (row.type == 'F') {
                            return $.view.statusShow(row,false,['禁止访问','可以访问']);
                        }
                        return $.view.statusShow(row,false,['隐藏','显示']);

                    }
                },
                {
                    field: 'perms',
                    title: '权限标识',
                    formatter: function(value, row, index) {
                        if(!value){
                            return '-';
                        }else{
                            return value;
                        }
                    }
                },
                {field: 'note', title: '备注',visible:false},
                {
                    title: '操作',
                    formatter: function(value, row, index) {
                        return '<a class="btn btn-success btn-xs" href="javascript:;" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a>                                                                              <a class="btn btn-info btn-xs" href="javascript:;" onclick="$.operate.add(\'' + row.id + '\')"><i class="fa fa-plus"></i>新增</a>                                                                                      <a class="btn btn-danger btn-xs" href="javascript:;" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>             ';
                    }
                }]
        };
        $.treeTable.init(options);
    });
</script>
</body>
</html>
